#ifndef _____WARD_TEXTBOX_CPP
#define _____WARD_TEXTBOX_CPP


#include "driver.h"
#include "textbox.h"


void textBox::drawDisabled()
{
	glColor4f(0.0,0.0,0.0,1.0);
		glRectf(xpos-border,ypos-border,xpos+width+border,ypos+width+border);
	glColor4f(cPri[0],cPri[1],cPri[2],1.0);
		glRectf(xpos,ypos,32,32);
	if(data == 1)
	{
	glColor4f(0.0,0.0,0.0,1.0);
		glLineWidth(2.0);
		glBegin(GL_LINES);
			glVertex2f(xpos, ypos);
			glVertex2f(xpos+width,ypos+width);
			glVertex2f(xpos+width, ypos);
			glVertex2f(xpos,ypos+width);
		glEnd();
		glLineWidth(1.0);

	}

	glColor4f(0.0,0.3,0.0,0.5);

}


void textBox::drawEnabled(int xpos, int ypos)
{

//light top border
glColor4f(cPri[0]+0.3,cPri[1]+0.3,cPri[2]+0.3,1.0);
glRectf(xpos-2,ypos-2,xpos+width,ypos);

//medium left border
glColor4f(cPri[0]+0.1,cPri[1]+0.1,cPri[2]+0.1,1.0);
glRectf(xpos-2,ypos,xpos,ypos+16);

//medium right border
glColor4f(cPri[0]+0.1,cPri[1]+0.1,cPri[2]+0.1,1.0);
glRectf(xpos+width,ypos-2,xpos+width+1,ypos+17);

//dark bottom border
glColor4f(cPri[0]-0.2,cPri[1]-0.2,cPri[2]-0.2,1.0);
glRectf(xpos-1,ypos+16,xpos+width,ypos+17);



glColor4f(cPri[0],cPri[1],cPri[2],1.0);
glRectf(xpos,ypos,xpos+width,ypos+16);


if(data == 1)
{
		glBegin(GL_POLYGON);
				glColor4f(cTer[0]+h_offs,cTer[1]+h_offs,cTer[2]+h_offs,1.0);
			glVertex3f(xpos, ypos, 0.0);
				glColor4f(cSec[0],cSec[1],cSec[2],1.0);
			glVertex3f(xpos+width, ypos, 0.0);
			glVertex3f(xpos+width, ypos+16, 0.0);
				glColor4f(cTer[0]+h_offs,cTer[1]+h_offs,cTer[2]+h_offs,1.0);
			glVertex3f(xpos, ypos+16, 0.0);
		glEnd();

}
else if(hovering)
{
		glBegin(GL_POLYGON);
				glColor4f(cTer[0]+h_offs,cTer[1]+h_offs,cTer[2]+h_offs,1.0);
			glVertex3f(xpos, ypos, 0.0);
				glColor4f(cSec[0],cSec[1],cSec[2],1.0);
			glVertex3f(xpos+width, ypos, 0.0);
			glVertex3f(xpos+width, ypos+16, 0.0);
				glColor4f(cTer[0]+h_offs,cTer[1]+h_offs,cTer[2]+h_offs,1.0);
			glVertex3f(xpos, ypos+16, 0.0);
		glEnd();
	
}

	glColor4f(cQua[0],cQua[1],cQua[2],1.0);

	//ADDED 4.29
	string writing = text;

	if(truncate_fileext)
		if(text.find('.'))
			writing = text.substr(0,text.find('.'));
	writeText(xpos,ypos+16,0.1,0.1,0,writing);
	//

}










#endif